package com.czy.fx.day1.stage;

import javafx.application.Application;
import javafx.application.ConditionalFeature;
import javafx.application.Platform;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

/**
 * Platform
 */
public class demo5 extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("Platform");

        /*UI线程*/
        Platform.runLater(()->{
            System.out.println("run:"+Thread.currentThread().getName());
        });
        System.out.println(Thread.currentThread().getName());

        /*设置关闭窗口是否退出程序*/
        Platform.setImplicitExit(false);
        //检测当前环境是否支持某些特性
        System.out.println("是否支持3D："+Platform.isSupported(ConditionalFeature.SCENE3D));
        primaryStage.show();

        /*立即退出程序*/
        Platform.exit();
    }
}